<?php
include('include/config.inc.php');
////Sub Category Selection : Start
$subcategoryId = $_REQUEST['subCategoryId'] == 'undefined' ? 0 : $_REQUEST['subCategoryId'];
$rowCount      = isset($_REQUEST['rowCount']) ? $_REQUEST['rowCount'] : 0;
$itemArr       = array();
$itemQuery = "SELECT itemId,itemName, modelNo
                FROM item
               WHERE subCategoryId = ".$subcategoryId." 	
            ORDER BY itemId";
$itemQueryRes = mysql_query($itemQuery);
$i = 0;
while($itemRow = mysql_fetch_array($itemQueryRes))
{
  $itemAjSelected          = isset($_REQUEST['itemIdSelected']) ? $_REQUEST['itemIdSelected']:0;
  $itemArr['itemId'][$i]   = $itemRow['itemId'];
  $itemArr['itemName'][$i] = $itemRow['itemName']." ~~~ ".$itemRow['modelNo'];
  $i++;
}
////Sub Category Selection : End
include("./bottom.php");
$smarty->assign("itemArr", $itemArr);
$smarty->assign("subcategoryId", $subcategoryId);
$smarty->assign("rowCount", $rowCount);
$smarty->assign("itemAjSelected", $itemAjSelected);
$smarty->display("itemAj.tpl");
?>